﻿using System;

namespace zaklad_rtv
{
    public class SingleCriterion<T> : ICriteria<T> where T : IDatabaseObject
    {
        private readonly Predicate<T> _predicate;

        public SingleCriterion(Predicate<T> predicate)
        {
            _predicate = predicate;
        }

        public bool IsMatched(T item)
        {
            return _predicate(item);
        }
    }
}